use chunks parameter for dataarray models#1031
Merged
LucaMarconato merged 4 commits intoscverse:mainfrom Dec 30, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1031 +/- ##
==========================================
+ Coverage 92.11% 92.20% +0.08%
==========================================
Files 49 49
Lines 7537 7547 +10
==========================================
+ Hits 6943 6959 +16
+ Misses 594 588 -6
🚀 New features to boost your workflow:
|
src/spatialdata/models/models.py
Outdated
| elif isinstance(data, np.ndarray | DaskArray): | ||
| if not isinstance(data, DaskArray): # numpy -> dask | ||
| data = from_array(data) | ||
| data = from_array(data.data) |
Member
There was a problem hiding this comment.
I'll revert and merge but happy to patch later in case it's needed.
Contributor
Author
There was a problem hiding this comment.
I think I just did that change, because on line 173 it also uses from_array(data.data)
Member
|
Great work and thanks for the PR! I added cases to the tests to cover also the cases in which the data is a dask array or a numpy array, and I added tests for the multiscale case. |
LucaMarconato
approved these changes
Dec 30, 2025
Member
LucaMarconato
left a comment
There was a problem hiding this comment.
Great work! Made some changes and merging now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried my hand to fix #1030
This should handle all instances where we want to have a
DataArrayafter parsing aRasterSchemamodel. ForDataTreesthe chunking is handled into_multiscaleAs I am new to your codebase I hope I adhered to all your guidelines. If not I am happy about any comments what I could improve.